import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

const routes = [
    {
        path: '/',
        redirect: '/project1',
    },
    {
        path: '/project1',
        name: 'project1',
        component: () => import('@/views/project1.vue'),
        children: [
            {
                path: 'detail',
                name: 'detail',
                component: () => import('@/views/project1Detail.vue'),
            },
        ],
    },
    {
        path: '/project2',
        name: 'project2',
        component: () => import('@/views/project2.vue'),
    },
];

export default new Router({
    mode: 'history',
    base: window.__POWERED_BY_QIANKUN__ ? '/project' : '/',
    routes,
});
